package com.kugong.anchor;

import com.jfinal.plugin.activerecord.Model;

import java.util.List;

/**
 *
 mysql> desc tb_anchor;

 * Created by Administrator on 2015/8/4.
 */
public class Anchor extends Model<Anchor> {
    public final static Anchor dao = new Anchor();

    /**
     * 查询60s内没更新过的主播
     * @return
     */
    public List<Anchor> qryAnchorStatus(){
        return find("SELECT * FROM tb_anchor where TIMESTAMPDIFF(SECOND,qry_time,NOW())>60");
    }

    /**
     * 查询主播信息
     * @return
     */
    public List<Anchor> qryAllAnchors(){
        return find("select * from tb_anchor ORDER BY status, comp");
    }


}
